
import java.util.ArrayList;
import java.util.Scanner;

class Mark {
	private double X;
	private double Y;

	Mark(double X, double Y) {
		this.X = X;
		this.Y = Y;
	}

	public double getX() {
		return X;
	}

	public double getY() {
		return Y;
	}

	public int getQuarter() {
		
		if (this.X > 0 & this.Y > 0)
			return 1;
		if (this.X < 0 & this.Y > 0)
			return 2;
		if (this.X < 0 & this.Y < 0)
			return 3;
		if (this.X > 0 & this.Y < 0)
			return 4;
		return 1;
	}
}

class Shape {
	private float R;

	Shape(float R) {
		this.R = R;
	}

	public boolean getResults(Mark mark) {

		if ((mark.getX() >= 0) && (mark.getY() >= 0)) {
			if (mark.getY() <= -2 * mark.getX() + R)
				return true;
		} else {
			if ((mark.getX() < 0) && (mark.getY() > 0)) {
				if (mark.getX() * mark.getX() + mark.getY() * mark.getY() <= R
						/ 2 * R / 2)
					return true;
			} else {
				if ((mark.getX() >= -R) && (mark.getY() >= -R) && (mark.getX()<=0) && (mark.getY()<=0))
					return true;
			}
		}

		return false;
	}
	
}

public class Lab3 {

	public static void main(String[] args) {
		String str;
		float f;
		//ArrayList<Mark> list = new ArrayList<Mark>();
		ArrayList<Mark> list = new ArrayList<Mark>();
		list.add(new Mark(3, 5));
		list.add(new Mark(1, 1));
		list.add(new Mark(3, -5));
		list.add(new Mark(-1, 1));
		list.add(new Mark(-3, -4));
		list.add(new Mark(0, -1));
		list.add(new Mark(-3, 3));
		System.out.print("revision 4");
		System.out.print("Введите R: ");
		Scanner scan = new Scanner(System.in);
		
		str = scan.nextLine();
		scan.close();
		try {
			f = Float.parseFloat(str);
		}
		catch (NumberFormatException e){
			System.out.println("Ошибка! Введите цифру");
			System.exit(0);
		}
		Shape shape = new Shape(Float.parseFloat(str));
		
		for (Object mark2 : list) {
			Mark mark = (Mark)mark2;
			if (shape.getResults(mark))
				System.out.println("Точка {" + mark.getX() + ", " + mark.getY()
						+ "} принадлежит области.\n");
			else
				System.out.println("Точка {" + mark.getX() + ", " + mark.getY()
						+ "} не принадлежит области.\n");
		}

	}

	public boolean parseR(String str) {
		float f;
		try {
			f = Float.parseFloat(str);
		}
		catch (NumberFormatException e){
			System.out.println("Ошибка! Введите цифру");
			return false;
		}
		
		return true;
	}

}
